module.exports = options => {
    return (req, res, next) => {
        const name = require('inflection').classify(req.params.resource)
        req.model = require(`../models/${name}`)
        next()
    }
}